<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:o="http://openfaces.org/">

	<rich:modalPanel id="editEasementDlg" width="450" height="400" zindex="10050">
		<f:facet name="header">
			<h:outputText value="#{messages['txt.easement.addnew']}"/>
		</f:facet>
		
		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage value="/img/close.png" styleClass="hidelink"
					id="hideEditEasementDlg" />
				<rich:componentControl for="editEasementDlg" attachTo="hideEditEasementDlg"
					operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>
		
		<h:form id="frmEditEasement">
			<h:panelGroup rendered="#{interactiveViewerHelper.parcelDataHelper.easement != null}">
				<div align="center">
					<h:outputText value="#{messages['txt.easement.data']}" style="font-weight:bold;" />
					<rich:separator lineType="solid"/>
					<br />
					<h:panelGrid columns="2" style="width:100%">
						<h:outputLabel value="#{messages['txt.easement.type']}" for="easement_type" />
						<h:selectOneMenu
							id="easement_type"
							value="#{interactiveViewerHelper.parcelDataHelper.easement.type}"
							converter="#{uiConverters.easementType}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.easementEditMode == 'VIEWING'}">
							<f:selectItems value="#{uiConverters.easementType.valueList}"/>
						</h:selectOneMenu>
	
						<h:outputLabel value="#{messages['txt.easement.document_type']}" for="document_type" />
						<h:selectOneMenu
							id="document_type"
							value="#{interactiveViewerHelper.parcelDataHelper.easement.documentType}"
							converter="#{uiConverters.documentType}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.easementEditMode == 'VIEWING'}">
							<f:selectItems value="#{uiConverters.documentType.valueList}" />
						</h:selectOneMenu>
	
						<h:outputLabel value="#{messages['txt.easement.beneficiary_number']}" for="beneficiary_number" />
						<h:inputText
							id="beneficiary_number"
							value="#{interactiveViewerHelper.parcelDataHelper.easement.beneficiaryNumber}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.easementEditMode == 'VIEWING'}">
						</h:inputText>
					</h:panelGrid>
					
					<br />
					<br />
					
					<h:outputText value="#{messages['txt.registry_data']}" style="font-weight:bold;" />
					<rich:separator lineType="solid"/>
					<br />
					<h:panelGrid columns="2">
						<h:outputLabel value="#{messages['txt.reg_number']}" for="reg_number2"/>
						<h:inputText
							id="reg_number2"
							label="#{messages['txt.reg_number']}"
							value="#{interactiveViewerHelper.parcelDataHelper.easement.registration.code}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.easementEditMode == 'VIEWING'}">
						</h:inputText>

						<h:outputLabel value="#{messages['txt.tome']}" for="tome2"/>
						<h:inputText
							id="tome2"
							label="#{messages['txt.tome']}"
							value="#{interactiveViewerHelper.parcelDataHelper.easement.registration.tome}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.easementEditMode == 'VIEWING'}">
						</h:inputText>
					
						<h:outputLabel value="#{messages['txt.folio']}" for="folio2" />
						<h:inputText
							id="folio2"
							label="#{messages['txt.folio']}"
							value="#{interactiveViewerHelper.parcelDataHelper.easement.registration.folio}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.easementEditMode == 'VIEWING'}">
						</h:inputText>
					
						<h:outputLabel value="#{messages['txt.annotation_number']}" for="annotation_number2"/>
						<h:inputText
							id="annotation_number2"
							label="#{messages['txt.annotation_number']}"
							value="#{interactiveViewerHelper.parcelDataHelper.easement.registration.annotationNumber}"
							readonly="#{interactiveViewerHelper.parcelDataHelper.easementEditMode == 'VIEWING'}">
						</h:inputText>
					</h:panelGrid>
					
					<h:panelGroup rendered="#{interactiveViewerHelper.parcelDataHelper.easementEditMode == 'VIEWING'}">
						<o:commandButton
							type="button"
							value="#{messages['button.ok']}"
							onclick="#{rich:component('editEasementDlg')}.hide()">
						</o:commandButton>
					</h:panelGroup>
					<h:panelGroup rendered="#{interactiveViewerHelper.parcelDataHelper.easementEditMode != 'VIEWING'}">
						<a4j:commandButton
							value="#{messages['button.ok']}"
							action="#{interactiveViewerHelper.parcelDataHelper.acceptEasement}"
							reRender="grpEasement"
							oncomplete="if (#{facesContext.maximumSeverity == null}) #{rich:component('editEasementDlg')}.hide(); else #{rich:component('msgPanel')}.show()">
						</a4j:commandButton>
						<o:commandButton
							type="button"
							value="#{messages['button.cancel']}"
							onclick="#{rich:component('editEasementDlg')}.hide()">
						</o:commandButton>
					</h:panelGroup>
				</div>
			</h:panelGroup>
		</h:form>
	</rich:modalPanel>

</ui:composition>
